1. Field of the Invention
The present invention relates to an imaging device and a control method for the imaging device capable of autofocus at high speed and with high accuracy by measuring a distance to the position of an object to be photographed using phase difference detection pixels formed on an imaging element.
2. Description of Related Art
High functionality of a digital camera has been astonishing, and the performance thereof is also progressing day by day. Various functions allow photographing of a high quality photograph regardless of the skill of a photographer. Autofocus is also one of these functions, and in order to appropriately photograph a moving object, it is necessary to accurately measure a distance to the position of the object, predict the position of the object based on the measured information, and drive the lens.
The autofocus system can be basically classified into an active system and a passive system. The active system is the system for irradiating an object with an infrared ray or the like from a camera and measuring the distance to the object using a signal reflected by the object. This system is used for some of digital camcorders and the like, but rarely used for lens interchangeable digital cameras and the like. On the other hand, the passive system is the system for performing ranging based on the light flux passing through an imaging lens, and is classified into a contrast system and a phase difference system.
The contrast system (hereinafter, contrast AF) is widely used for a compact digital camera and a lens interchangeable digital camera, and is the system for reading an image signal from an imaging element while moving the position of a focus lens in the optical axis direction, calculating a contrast value (AF evaluation value) from the image signal for each frame, searching the maximum value of the contrast values, and setting the position of the focus lens where the maximum value is obtained, as the focusing position.
The phase difference system is the system for dividing the pupil of an imaging lens into a pair of regions, detecting a relative positional change between a pair of images formed by a light flux passing through the divided pupil regions, and thereby detecting the focusing position. This phase difference system includes: a system with a dedicated detection unit (hereinafter, a dedicated unit system) (Japanese Laid-Open Patent Publication No. 8-211284, hereinafter referred to as Patent Literature 1) and Japanese Laid-Open Patent Publication No. 7-110435, hereinafter referred to as Patent Literature 2); and a system of forming a pixel for detecting the phase difference on an imaging element during the course of manufacturing the imaging element (hereinafter, an imaging-plane phase difference system) (Japanese Laid-Open Patent Publication No. 2008-134413, hereinafter referred to as Patent Literature 3) and Japanese Laid-Open Patent Publication No. 2008-147821, hereinafter referred to as Patent Literature 4). The phase difference system is quite often used for the lens interchangeable digital camera.
The contrast system needs the image data obtained by photographing at different timings while varying the lens position in order to detect the focusing position, on the other hand, the phase difference system is capable of detecting the focusing position from the image data obtained by one exposure. Therefore, the phase difference system is suitable for photographing a moving object. Moreover, in the dedicated unit system of the phase difference system a dedicated detection unit needs to be provided inside a camera and therefore the camera body becomes bigger and heavier. Therefore, the system capable of appropriately photographing a moving object and suitable for a compact and lightweight camera body is the imaging-plane phase difference system.
In the imaging-plane phase difference system, a phase detection pixel is formed on an imaging element. That is, the phase difference detection pixel instead of the imaging pixel is formed, and therefore if the phase difference detection pixels are arranged densely on the imaging element, the image degradation of a photographed image becomes significant, and the imaging-plane phase difference system is inappropriate for use in a digital camera. Accordingly, in order to reduce the influence on a photographed image as much as possible, it is preferable to roughly and discretely arrange the phase difference detection pixels to be formed on the imaging element.
However, if the phase difference detection pixels are discretely arranged on the imaging element, a reduction in AF accuracy will occur due to an object with a fine pattern and/or due to a distance measurement variation (a light amount difference or the like between the left and right apertures) when the position of an object slightly changes on an imaging plane, such as the movement of an object. Therefore, in particular, in measuring a distance to a moving object by continuous AF (hereinafter, abbreviated as C-AF), a distance measurement variation causes a variation (error) also in the result of moving body prediction calculation, and therefore the focusing accuracy of an image to be photographed will decrease. Then, a decrease in the focusing accuracy of an image to be photographed by C-AF is preferably prevented by suppressing the variation for each measurement.
The decrease in the focusing accuracy is described using FIG. 9A and FIG. 9B. FIG. 9A and FIG. 9B show the position of an object and distance measurement result during photographing. FIG. 9A shows that an object is moving toward the near side from the infinity side. That is, an image 1 indicates an object image at a time instant T1, and an image 2 indicates the object image at a time instant T2. The object image becomes gradually bigger because it is moving toward the near side from the infinity side. 3×3 frames 1a and 2a in the images 1 and 2 indicate the respective AF areas. In the respective AF areas, the focusing position of the object is calculated by detecting the defocusing amount.
In FIG. 9B, the horizontal axis represents the object position and the vertical axis represents the lens position in focusing that is calculated based on the detected defocusing amount. As seen from FIG. 9B, when an object is on the infinity side, a value indicative of the focusing position of a lens is small, and as the object approaches the nearer side, the value increases, and becomes maximum when the object is on the nearest side. In the example shown in FIG. 9B, at object positions L1, L2, and L3, the lens position significantly shifts from the lens position at the other positions, and this is due to a distance measurement variation. This distance measurement variation is caused by the arrangement method in arranging the phase difference detection pixels on the imaging element, the pattern of an object, the position of an object, and the like. If there is a distance measurement variation in performing moving body prediction based on these data, the prediction accuracy will decrease due to the influence of the variation and the focusing accuracy will decrease.
In Patent Literature 1, in the autofocus system using the AF dedicated unit, focus detection is performed on a plurality of portions of an object, and the focus detection result is displayed or the photographing lens is driven taking into consideration the depth of an object from the detection results of a plurality of calculated image deviation amounts. Patent Literature 1 discloses that a photoelectric output is divided into a plurality of portions to calculate a plurality of image deviation amounts. However, the technique disclosed in Patent Literature 1 cannot cope with a distance measurement variation that is generated when the position of an object slightly varies on an imaging plane, such as a case where an object has a fine pattern and a case where an object moves.
Patent Literature 2 discloses that the photographing range is divided into a plurality of regions, the contrast is calculated for each region, and a region where a main object exists is obtained. However, in Patent Literature 2, the contrast is used for detection of a main object, but is not used for suppression of the distance measurement variation.
Patent Literature 3 discloses that when the aperture is narrowed in order to secure the AF accuracy of the imaging-plane phase difference system, a photoelectric conversion section configured to generate each charge signal related to a pair of image sequences is selected in accordance with an aperture value. However, the technique disclosed in Patent Literature 3 cannot cope with a distance measurement variation that is generated when the position of an object slightly varies on an imaging plane, such as a case where an object has a fine pattern and a case where an object moves.
Patent Literature 4 discloses that in order to suppress a reduction in AF accuracy due to an aperture value in the imaging-plane phase difference system, a pixel of a different light-shielding rate is selected based on an aperture value. However, the AF system described in Patent Literature 4 cannot suppress the distance measurement variation.